|
|   Rules for the game of exorcist patience
|   Designed by J.Horsnell BSc(Hons) MSc
|   For SPatience Vsn. 0.51 and up! 
|
| Blat.......
|   Imagine that, my own game and someone goes and spots an error.
|   The game refuses to acknowledge a winning move. This was spotted
|   by S.Fakhry and occurs because I forgot to assign the foundation
|   stacks an ID. It was supposed to be 2.
|
|   This is my own (quickly thought up) game. It's not very difficult,
|   enjoy....  The stacks on the left are of the same colour descending
|   value variety. Those on the right are of the different colour
|   descending variety. Whole stacks must conform to the rules when
|   moving to a new home. The pack deal one to each stack.
|
| This file may provide as an introduction to
| writing SPatience script files of your own.
|
| SPatience knows one script type at the moment but it must be declared
SCRIPT_TYPE 1
|

| Open a window with this title. (case sensitive inside quotes)
BEGIN "Exorcist"

| Declare the game state flag defaults
  FLAGS ClickFly AutoFly AnimateFly

| We need 4 packs for this game
  PACKS 4

| The window width is 17 stack widths
  WIDTH 17 * CW

| Lets have a maximum height
  HEIGHT 2 * CH + 7 * COH + 9 * COH + 11 * COH

| We win if there are 208 cards (all of them) in the foundations
  ZeroToWin 208 - CARDSIN$2

| Now define the foundations.
  FOR foundation = 0 to 7

|   These are standard foundations, mostly default.
|   First the left eight.
    FOUNDATION
      X CW * foundation
      Y 0
      ID 2
    END FOUNDATION

|   Now the right...
    FOUNDATION
      X 16 * CW - foundation * CW
      Y 0
      ID 2
    END FOUNDATION

  END FOR

| Now for the stacks (eight left, eight right)
  FOR stack = 0 TO 7

|   First the left
    STACK
|     Each one below a foundation
      X stack * CW
      Y CH
|     Allow only kings to be placed on empty stacks
      FIRST 13
|     We want one card on the left increasing to eight in the middle
      DEAL stack + 1 , stack + 1
|     We need deep stack checking when adding stacks
|     and only cards of the same colour can be added.
|     The card value offset is the default of decrementing by one.
|     These stacks can also accept cards after a click operation.
      FLAGS PaintDown DeepCheck ClickFly Join__SC Drag__SC
|     An ID of 1, this is were the pack will deal to.
      ID 1
      DragOffset -1
    END STACK

|   Now the right
    STACK
|     One card at the far right, eight in the middle
      X 16 * CW - stack * CW
|     All else is the same as those on the left....
      Y CH
      FIRST 13
      DEAL stack + 1 , stack + 1
|     Except the way stacks append (different colour)
      FLAGS DeepCheck ClickFly Join__DC Drag__DC
      ID 1
      DragOffset -1
    END STACK

  END FOR

| We need a stack to hold the cards left to deal.
  STACK
|   Put it in the middle of the foundations
    X 8 * CW
    Y 0
|   We don't want any cards to be added
    MAX 0
|   After the stacks, there are 136 cards left....
    DEAL 136
|   To each stack (ID=1) we deal one card.
    DEALTO 1,1
|   We don't want to take them back when dealt.
    TAKEFROM 0
|   The pack is deal only, no dragging.
    DRAGUPTO 0
|   It's display should be the card back and a count of cards left
    FLAGS PaintCount
  END STACK

END BEGIN
